<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function sort(){
        var length=arguments.length;
        var arr=arguments;
        var arr2=[];
        var num=[];
        var num2=[];
        var cc=[];
        for(var i=0;i<arr.length;i++){
            arr2.push(arr[i][0]);
            num.push(arr[i][1]);
            num2.push(arr[i][2]);
        }
        arr2.sort();
        num.sort();
        num2.sort();
        for(var i=0;i<arr.length;i++){
            cc.push(arr2[i]+" "+num[i]+" "+num2[i]+"\n");
        }
        console.log(cc);
    }
    sort(["sdsd",1,20],["sd",18,20],["s",18,20]);

</script>
</body>
</html>